package com.fdb.efp.nls.service.impl;

import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.efp.nls.service.dao.AccLedgerFileTempDao;
import com.fdb.efp.nls.service.domain.AccLedgerFileTemp;
import com.fdb.efp.nls.service.facade.AccLedgerFileTempService;
import com.fdb.efp.nls.service.vo.AccLedgerFileTempVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("accLedgerFileTempService")
public class AccLedgerFileTempServiceImpl implements AccLedgerFileTempService,FrameworkService{
	private static Logger logger = LoggerFactory.getLogger(BatCircleaccServiceImpl.class);
	
	@Autowired
	private AccLedgerFileTempDao accLedgerFileTempDao;
	
	@Override	
	public int insert(AccLedgerFileTempVO accLedgerFileTempVO) {// vo
		logger.debug("当前新增数据为:" + accLedgerFileTempVO.toString());
		int num = 0;
		try {
			AccLedgerFileTemp accLedgerFileTemp = new AccLedgerFileTemp();
			beanCopy(accLedgerFileTempVO, accLedgerFileTemp);
			num = accLedgerFileTempDao.insert(accLedgerFileTemp);
		} catch (Exception e) {
			logger.error("新增数据发生异常!", e);
			num = -1;
		}
		logger.debug("当前新增数据条数为:" + num);
		return num;
	}

	@Override
	public int insertSelective(AccLedgerFileTempVO record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<AccLedgerFileTempVO> getAccLedgerFileTempDaoList() {
		logger.debug("当前查询数据信息的参数信息为:");
		List<AccLedgerFileTempVO> list = null;
		try {
			List<AccLedgerFileTemp> accLedgerFileTemps = accLedgerFileTempDao.getAccLedgerFileTempDaoList();
			logger.debug("当前查询数据信息的结果集数量为:" + accLedgerFileTemps.size());			
			list = (List<AccLedgerFileTempVO>) beansCopy(accLedgerFileTemps, AccLedgerFileTempVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;
	}

}
